package com.zlp.netty.nio;

import java.io.IOException;
import java.io.PrintStream;
import java.net.InetAddress;
import java.net.Socket;
import java.util.Scanner;

/**
 * @author: zhulaiping
 * @time: 2022/8/4 16:30
 */
public class TCPClient1 {

    //客户端，发信息到服务端
    //todo:关闭连接(不是代码关闭，)前，先关闭IO
    public static void main(String[] args) throws IOException {
        /*InetAddress byName = InetAddress.getByName("127.0.0.1");
        Socket socket = new Socket(byName,9999);
        PrintStream ps = new PrintStream(socket.getOutputStream());
        Scanner sc = new Scanner(System.in);
        while (true){
            System.out.println("请输入待发送消息：");
            String msg = sc.nextLine();
            if(msg.equals("11")) break;
            ps.println(msg);
            ps.flush();
        }
        socket.close();*/
        //socket.shutdownOutput();
        //阻塞式IO,输出流必须关闭，服务端才能正常接收数据
        //ps.close();
        test();
    }

    private static void test() {
        System.out.println(-1 % 3);
    }


}
